/**
 * Created by heht on 2017/03/27.
 */
import Constant from 'common/constant'
/**
 * @class app.common.localDAO
 */
var LocalDAO = {};

/**
 * 初始化 userCode
 * @method initUserCode
 * @return 无返回值
 */
LocalDAO.initUserCode = (function () {
  if (localStorage.getItem(Constant.storage.USER_CODE) == null) {
    localStorage.setItem(Constant.storage.USER_CODE, "");
  }
})();

/**
 * 初始化 当前被查看牛人userCode
 * @method initUserCode
 * @return 无返回值
 */
LocalDAO.initOtherUserCode = (function () {
  if (localStorage.getItem(Constant.storage.OTHER_USER_CODE) == null) {
    localStorage.setItem(Constant.storage.OTHER_USER_CODE, "");
  }
})();

/**
 * 初始化当前登录用户昵称
 * @method initNickname
 * @return 无返回值
 */
LocalDAO.initNickname = (function () {
  if (localStorage.getItem(Constant.storage.NICKNAME) == null) {
    localStorage.setItem(Constant.storage.NICKNAME, "");
  }
})();

/**
 * 初始化当前被查看牛人昵称
 * @method initOtherNickname
 * @return 无返回值
 */
LocalDAO.initOtherNickname = (function () {
  if (localStorage.getItem(Constant.storage.OTHER_NICKNAME) == null) {
    localStorage.setItem(Constant.storage.OTHER_NICKNAME, "");
  }
})();

/**
 * 初始化头像路径
 * @method initUserHead
 * @return 无返回值
 */
LocalDAO.initUserHead = (function () {
  if (localStorage.getItem(Constant.storage.USER_HEAD) == null) {
    localStorage.setItem(Constant.storage.USER_HEAD, Constant.url.DEFAULT_USER_HEAD);
  }
})();

/**
 * 初始化当前被查看牛人头像路径
 * @method initUOtherserHead
 * @return 无返回值
 */
LocalDAO.initOtherUserHead = (function () {
  if (localStorage.getItem(Constant.storage.OTHER_USER_HEAD) == null) {
    localStorage.setItem(Constant.storage.OTHER_USER_HEAD, Constant.url.DEFAULT_USER_HEAD);
  }
})();

/**
 * 初始化君元宝数
 * @method initWalletTotal
 * @return 无返回值
 */
LocalDAO.initWalletTotal = (function () {
  if (localStorage.getItem(Constant.storage.WALLET_TOTAL) == null) {
    localStorage.setItem(Constant.storage.WALLET_TOTAL, "");
  }
})();

/**
 * 初始化当前被查看牛人君元宝数
 * @method initOtherWalletTotal
 * @return 无返回值
 */
LocalDAO.initOtherWalletTotal = (function () {
  if (localStorage.getItem(Constant.storage.OTHER_WALLET_TOTAL) == null) {
    localStorage.setItem(Constant.storage.OTHER_WALLET_TOTAL, "--");
  }
})();

/**
 * 初始化总盈利率
 * @method initTotalRate
 * @return 无返回值
 */
LocalDAO.initTotalRate = (function () {
  if (localStorage.getItem(Constant.storage.TOTAL_RATE) == null) {
    localStorage.setItem(Constant.storage.TOTAL_RATE, "%");
  }
})();

/**
 * 初始化今日盈亏率
 * @method initDayRate
 * @return 无返回值
 */
LocalDAO.initDayRate = (function () {
  if (localStorage.getItem(Constant.storage.DAY_RATE) == null) {
    localStorage.setItem(Constant.storage.DAY_RATE, "--%");
  }
})();

/**
 * 初始化累计盈亏金额
 * @method initTotalFloatProfit
 * @return 无返回值
 */
LocalDAO.initTotalFloatProfit = (function () {
  if (localStorage.getItem(Constant.storage.TOTAL_FLOAT_PROFIT) == null) {
    localStorage.setItem(Constant.storage.TOTAL_FLOAT_PROFIT, "");
  }
})();

/**
 * 初始化总资产金额
 * @method initFundBalance
 * @return 无返回值
 */
LocalDAO.initFundBalance = (function () {
  if (localStorage.getItem(Constant.storage.FUND_BALANCE) == null) {
    localStorage.setItem(Constant.storage.FUND_BALANCE, "--");
  }
})();

/**
 * 初始化可用资产金额
 * @method initAvailableAssets
 * @return 无返回值
 */
LocalDAO.initAvailableAssets = (function () {
  if (localStorage.getItem(Constant.storage.AVAILABLE_ASSETS) == null) {
    localStorage.setItem(Constant.storage.AVAILABLE_ASSETS, "--");
  }
})();

/**
 * 初始化被订阅数
 * @method initSubscribeUserCount
 * @return 无返回值
 */
LocalDAO.initSubscribeUserCount = (function () {
  if (localStorage.getItem(Constant.storage.SUBSCRIBE_USER_COUNT) == null) {
    localStorage.setItem(Constant.storage.SUBSCRIBE_USER_COUNT, "--");
  }
})();

/**
 * 初始化当前用户订阅的人数
 * @method initMySubscribeCount
 * @return 无返回值
 */
LocalDAO.initMySubscribeCount = (function () {
  if (localStorage.getItem(Constant.storage.MY_SUBSCRIBE_COUNT) == null) {
    localStorage.setItem(Constant.storage.MY_SUBSCRIBE_COUNT, "0");
  }
})();


/**
 * 初始化消息数
 * @method initMessages
 * @return 无返回值
 */
LocalDAO.initMessages = (function () {
  if (localStorage.getItem(Constant.storage.MESSAGES) == null) {
    localStorage.setItem(Constant.storage.MESSAGES, "");
  }
})();

/**
 * 初始化消息数
 * @method initThumbUpNum
 * @return 无返回值
 */
LocalDAO.initThumbUpNum = (function () {
  if (localStorage.getItem(Constant.storage.THUMB_UP_NUM) == null) {
    localStorage.setItem(Constant.storage.THUMB_UP_NUM, "");
  }
})();

/**
 * 初始化订阅价格
 * @method initSubscribePrice
 * @return 无返回值
 */
LocalDAO.initSubscribePrice = (function () {
  if (localStorage.getItem(Constant.storage.SUBSCRIBE_PRICE) == null) {
    localStorage.setItem(Constant.storage.SUBSCRIBE_PRICE, "0");
  }
})();


/**
 * 初始化点赞数
 * @method initGoodpointCount
 * @return 无返回值
 */
LocalDAO.initGoodpointCount = (function () {
  if (localStorage.getItem(Constant.storage.GOODPOINT_COUNT) == null) {
    localStorage.setItem(Constant.storage.GOODPOINT_COUNT, "");
  }
})();

/**
 * 初始化当前登录用户所获勋章列表
 * @method initMedalsOwned
 * @return 无返回值
 */
LocalDAO.initMedalsOwned = (function () {
  if (localStorage.getItem(Constant.storage.MEDALS_OWNED) == null) {
    var medalsOwned = {};

    var list = [];
    medalsOwned.list = list;

    localStorage.setItem(Constant.storage.MEDALS_OWNED, JSON.stringify(medalsOwned));
  }
})();

/**
 * 初始化当前被查看牛人所获勋章列表
 * @method initOtherMedalsOwned
 * @return 无返回值
 */
LocalDAO.initOtherMedalsOwned = (function () {
  if (localStorage.getItem(Constant.storage.OTHER_MEDALS_OWNED) == null) {
    var otherMedalsOwned = {};

    var list = [];
    otherMedalsOwned.list = list;

    localStorage.setItem(Constant.storage.OTHER_MEDALS_OWNED, JSON.stringify(otherMedalsOwned));
  }
})();

/**
 * 初始化所有获勋章列表
 * @method initMedalsAll
 * @return 无返回值
 */
LocalDAO.initMedalsAll = (function () {
  if (localStorage.getItem(Constant.storage.MEDALS_ALL) == null) {
    var medalsAll = {};

    var myxzList = [];
    var zxxzList = [];
    var thxzList = [];

    medalsAll.myxzList = myxzList;
    medalsAll.zxxzList = zxxzList;
    medalsAll.thxzList = thxzList;

    localStorage.setItem(Constant.storage.MEDALS_ALL, JSON.stringify(medalsAll));
  }
})();

/**
 * 初始化牛人秀列表
 * @method initRockmansShow
 * @return 无返回值
 */
LocalDAO.initRockmansShow = (function () {
  if (localStorage.getItem(Constant.storage.ROCKMANS_SHOW) == null) {
    var rockmansShow = {};

    var list = [];
    // list.push(item);

    rockmansShow.list = list;

    localStorage.setItem(Constant.storage.ROCKMANS_SHOW, JSON.stringify(rockmansShow));
  }
})();

/**
 * 初始化点赞我的牛人列表
 * @method initRockmansAdmirers
 * @return 无返回值
 */
LocalDAO.initRockmansAdmirers = (function () {
  if (localStorage.getItem(Constant.storage.ROCKMANS_ADMIRERS) == null) {
    var rockmansAdmirers = {};

    var list = [];

    rockmansAdmirers.list = list;

    localStorage.setItem(Constant.storage.ROCKMANS_ADMIRERS, JSON.stringify(rockmansAdmirers));
  }
})();

/**
 * 初始化我的粉丝列表
 * @method initRockmansFans
 * @return 无返回值
 */
LocalDAO.initRockmansFans = (function () {
  if (localStorage.getItem(Constant.storage.ROCKMANS_FANS) == null) {
    var rockmansFans = {};

    var list = [];

    rockmansFans.list = list;

    localStorage.setItem(Constant.storage.ROCKMANS_FANS, JSON.stringify(rockmansFans));
  }
})();

/**
 * 初始化组合秀列表
 * @method initPortfoliosShow
 * @return 无返回值
 */
LocalDAO.initPortfoliosShow = (function () {
  if (localStorage.getItem(Constant.storage.PORTFOLIOS_SHOW) == null) {
    var portfoliosShow = {};

    // var item = {};
    // item.grossRate = "12.87%";
    // item.portfolioName = "明明熔断了";
    // item.creator = "张三";
    // item.followers = "20";

    var list = [];
    // list.push(item);

    portfoliosShow.list = list;

    localStorage.setItem(Constant.storage.PORTFOLIOS_SHOW, JSON.stringify(portfoliosShow));
  }
})();

/**
 * 初始化官方比赛列表
 * @method initGamesOfficial
 * @return 无返回值
 */
LocalDAO.initGamesOfficial = (function () {
  if (localStorage.getItem(Constant.storage.GAMES_OFFICIAL) == null) {
    var gamesOfficial = {};

    // var item = {};
    // item.name = "一季度官方比赛";
    // item.startDate = "2016.4.2";
    // item.endDate = "2016.10.30";
    // item.points = "1000";
    // item.totalPlayers = "20";

    var list = [];
    // list.push(item);

    gamesOfficial.list = list;

    localStorage.setItem(Constant.storage.GAMES_OFFICIAL, JSON.stringify(gamesOfficial));
  }
})();

/**
 * 初始化订阅的牛人列表
 * @method initRockmansSub
 * @return 无返回值
 */
LocalDAO.initRockmansSub = (function () {
  if (localStorage.getItem(Constant.storage.ROCKMANS_SUB) == null) {
    var rockmansSub = {};

    var list = [];
    rockmansSub.list = list;

    localStorage.setItem(Constant.storage.ROCKMANS_SUB, JSON.stringify(rockmansSub));
  }
})();

/**
 * 初始化参加的比赛列表
 * @method initGamesJoin
 * @return 无返回值
 */
LocalDAO.initGamesJoin = (function () {
  if (localStorage.getItem(Constant.storage.GAMES_JOIN) == null) {
    var gamesJoin = {};

    // var item = {};
    // item.gameId = "";
    // item.gameName = "一季度股王大赛";
    // item.startDate = "2016.4.2";
    // item.endDate = "2016.10.30";
    // item.yieldRate = "7";
    // item.totalPlayers = "20";
    // item.ranking = "3";

    var list = [];
    // list.push(item);

    gamesJoin.list = list;

    localStorage.setItem(Constant.storage.GAMES_JOIN, JSON.stringify(gamesJoin));
  }
})();

/**
 * 初始化创建的比赛列表
 * @method initGamesCreate
 * @return 无返回值
 */
LocalDAO.initGamesCreate = (function () {
  if (localStorage.getItem(Constant.storage.GAMES_CREATE) == null) {
    var gamesCreate = {};

    // var item = {};
    // item.gameId = "";
    // item.gameName = "大牛团队pk赛";
    // item.startDate = "2016.4.2";
    // item.endDate = "2016.10.30";
    // item.daysRemaining = "7";
    // item.newPlayers = "3";
    // item.totalPlayers = "20";
    // item.maxPlayers = "50";

    var list = [];
    // list.push(item);

    gamesCreate.list = list;

    localStorage.setItem(Constant.storage.GAMES_CREATE, JSON.stringify(gamesCreate));
  }
})();

/**
 * 初始化比赛投票榜列表
 * @method initGamesCreate
 * @return 无返回值
 */
LocalDAO.initGameVote = (function () {
  if (localStorage.getItem(Constant.storage.GAME_VOTE) == null) {
    localStorage.setItem(Constant.storage.GAMES_CREATE, JSON.stringify({players:[]}));
  }
})();

/**
 * 初始化我的个股列表
 * @method initMyStocks
 * @return 无返回值
 */
LocalDAO.initMyStocks = (function () {
  if (localStorage.getItem(Constant.storage.MY_STOCKS) == null) {
    var myStocks = {};

    // var item = {};
    // item.stockName = "浦发银行";
    // item.stockCode = "600001";
    // item.costPrice = "10.63";
    // item.marketPrice = "12.30";
    // item.quantity = "1000";
    // item.income = "200";

    var list = [];
    // list.push(item);

    myStocks.list = list;

    localStorage.setItem(Constant.storage.MY_STOCKS, JSON.stringify(myStocks));
  }
})();

/**
 * 初始化他人个股列表
 * @method initOtherStocks
 * @return 无返回值
 */
LocalDAO.initOtherStocks = (function () {
  if (localStorage.getItem(Constant.storage.OTHER_STOCKS) == null) {
    var otherStocks = {};

    // var item = {};
    // item.stockName = "浦发银行";
    // item.stockCode = "600001";
    // item.costPrice = "10.63";
    // item.marketPrice = "12.30";
    // item.quantity = "1000";
    // item.income = "200";

    var list = [];
    // list.push(item);

    otherStocks.list = list;

    localStorage.setItem(Constant.storage.OTHER_STOCKS, JSON.stringify(otherStocks));
  }
})();

/**
 * 初始化我的组合列表
 * @method initMyPortfolios
 * @return 无返回值
 */
LocalDAO.initMyPortfolios = (function () {
  if (localStorage.getItem(Constant.storage.MY_PORTFOLIOS) == null) {

    var myPortfolios = {};

    // var item = {};
    // item.id = "111";
    // item.name = "明明熔断了";
    // item.position = "12.34%";
    // item.income = "45";

    var list = [];
    // list.push(item);

    myPortfolios.list = list;

    localStorage.setItem(Constant.storage.MY_PORTFOLIOS, JSON.stringify(myPortfolios));
  }
})();


/**
 * 初始化我的比赛持仓信息的上半部分
 * @method initGameAsset
 * @return 无返回值
 */
LocalDAO.initGameAsset = (function () {
  if (localStorage.getItem(Constant.game.position.GAMEASSET) == null) {

    var gameAsset = {};

    // var item = {};
    // item.id = "111";
    // item.name = "明明熔断了";
    // item.position = "12.34%";
    // item.income = "45";
    var list =
    {
      "total_profitrate": "-",
      "total_balance": "-",
      "ranknum": "-",
      "position": "-",
      "market_balance": "-",
      "income_balance": "-",
      "avail_balance": "-"
    };

    gameAsset = list;

    localStorage.setItem(Constant.game.position.GAMEASSET, JSON.stringify(gameAsset));
  }
})();

/**
 * 初始化我的比赛持仓信息的下半部分
 * @method initGameAssetDetail
 * @return 无返回值
 */
LocalDAO.initGameAssetDetail = (function () {
  if (localStorage.getItem(Constant.game.position.GAMEASSETDETAIL) == null) {

    var gameAsset = {};

    // var item = {};
    // item.id = "111";
    // item.name = "明明熔断了";
    // item.position = "12.34%";
    // item.income = "45";
    var list = [];

    gameAsset.list = list;

    localStorage.setItem(Constant.game.position.GAMEASSETDETAIL, JSON.stringify(gameAsset));
  }
})();

/**
 * 初始化他人组合列表
 * @method initOtherPortfolios
 * @return 无返回值
 */
LocalDAO.initOtherPortfolios = (function () {
  if (localStorage.getItem(Constant.storage.OTHER_PORTFOLIOS) == null) {

    var otherPortfolios = {};

    // var item = {};
    // item.id = "111";
    // item.name = "明明熔断了";
    // item.position = "12.34%";
    // item.income = "45";

    var list = [];
    // list.push(item);

    otherPortfolios.list = list;

    localStorage.setItem(Constant.storage.OTHER_PORTFOLIOS, JSON.stringify(otherPortfolios));
  }
})();

/**
 * 初始化易阳指前端token
 * @method inityyzToken
 * @return 无返回值
 */
LocalDAO.inityyzToken = (function () {
  if (localStorage.getItem(Constant.YYZ_TOKEN) == null) {
    localStorage.setItem(Constant.YYZ_TOKEN, "");
  }
})();

// 组合详情分享页
LocalDAO.initShareGroup = (function () {
  if (localStorage.getItem(Constant.storage.SHARE_GROUP) == null) {

    var shareGroup = {};
    shareGroup.group_data = {};
    shareGroup.transfer_data = {};
    shareGroup.position_data = {};
    shareGroup.similar_data = {};
    shareGroup.optionMonth = {};
    shareGroup.optionYear = {};
    shareGroup.client_id = '';
    shareGroup.group_id = '';
    shareGroup.isLogin = false;

    localStorage.setItem(Constant.storage.SHARE_GROUP, JSON.stringify(shareGroup));
  }
})();

/**
 * @method getShareGroup
 * @return {String}
 */
LocalDAO.getShareGroup = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.SHARE_GROUP));
};

/**
 * @method SetShareGroup
 * @return 无返回值
 */
LocalDAO.setShareGroup = function (shareGroup) {
  localStorage.setItem(Constant.storage.SHARE_GROUP, JSON.stringify(shareGroup));
};

// 点赞我的人分享页
LocalDAO.initShareAdmirers = (function () {
  if (localStorage.getItem(Constant.storage.SHARE_ADMIRERS) == null) {

    var shareAdmirers = {};
    shareAdmirers.overview = {};
    shareAdmirers.rockmans = {};
    shareAdmirers.adDownload = {};

    localStorage.setItem(Constant.storage.SHARE_ADMIRERS, JSON.stringify(shareAdmirers));
  }
})();

/**初始化我的比赛持仓页的缓存
 * @method initShareGameSelfDetail
 * @return {String}
 */
LocalDAO.initShareGameSelfDetail = (function () {
  if (localStorage.getItem("share" + Constant.page.GAME_SELF_DETAIL) == null) {

    var gameSelfDetail = {};
    gameSelfDetail.userhead = "";
    gameSelfDetail.nickname = "";
    gameSelfDetail.baseInfo = {};
    gameSelfDetail.totalPosition = [];

    //localStorage.setItem(Constant.storage.SHARE_ADMIRERS, JSON.stringify(shareAdmirers));
  }
})();

/**
 * @method getShareAdmirers
 * @return {String}
 */
LocalDAO.getShareAdmirers = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.SHARE_ADMIRERS));
};

/**
 * @method SetShareAdmirers
 * @return 无返回值
 */
LocalDAO.setShareAdmirers = function (shareAdmirers) {
  localStorage.setItem(Constant.storage.SHARE_ADMIRERS, JSON.stringify(shareAdmirers));
};


// 我的粉丝分享页
LocalDAO.initShareFans = (function () {
  if (localStorage.getItem(Constant.storage.SHARE_FANS) == null) {

    var shareFans = {};
    shareFans.overview = {};
    shareFans.rockmans = {};
    shareFans.adDownload = {};

    localStorage.setItem(Constant.storage.SHARE_FANS, JSON.stringify(shareFans));
  }
})();

/**
 * @method getShareFans
 * @return {String}
 */
LocalDAO.getShareFans = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.SHARE_FANS));
};

/**
 * @method setShareFans
 * @return 无返回值
 */
LocalDAO.setShareFans = function (shareFans) {
  localStorage.setItem(Constant.storage.SHARE_FANS, JSON.stringify(shareFans));
};

// 勋章墙分享页
LocalDAO.initShareMedalsWall = (function () {
  if (localStorage.getItem(Constant.storage.SHARE_MEDALS_WALL) == null) {

    var shareMedalsWall = {};
    shareMedalsWall.overview = {};
    shareMedalsWall.medals = {};
    shareMedalsWall.medals.myxzList = {};
    shareMedalsWall.medals.zxxzList = {};
    shareMedalsWall.medals.thxzList = {};
    shareMedalsWall.honorCodesOwned = {};
    shareMedalsWall.adDownload = {};

    localStorage.setItem(Constant.storage.SHARE_MEDALS_WALL, JSON.stringify(shareMedalsWall));
  }
})();

/**
 * @method getShareMedalsWall
 * @return {String}
 */
LocalDAO.getShareMedalsWall = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.SHARE_MEDALS_WALL));
};

/**
 * @method setShareMedalsWall
 * @return 无返回值
 */
LocalDAO.setShareMedalsWall = function (shareMedalsWall) {
  localStorage.setItem(Constant.storage.SHARE_MEDALS_WALL, JSON.stringify(shareMedalsWall));
};

// 单枚勋章分享页
LocalDAO.initShareMedal = (function () {
  if (localStorage.getItem(Constant.storage.SHARE_MEDAL) == null) {

    var shareMedal = {};
    shareMedal.overview = {};
    shareMedal.adDownload = {};

    localStorage.setItem(Constant.storage.SHARE_MEDAL, JSON.stringify(shareMedal));
  }
})();

/**
 * @method getShareMedal
 * @return {String}
 */
LocalDAO.getShareMedal = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.SHARE_MEDAL));
};

/**
 * @method setShareMedal
 * @return 无返回值
 */
LocalDAO.setShareMedal = function (shareMedal) {
  localStorage.setItem(Constant.storage.SHARE_MEDAL, JSON.stringify(shareMedal));
};


// 他人详情分享页
LocalDAO.initShareOtherDetails = (function () {
  if (localStorage.getItem(Constant.storage.SHARE_OTHER_DETAILS) == null) {

    var shareOtherDetails = {};

    shareOtherDetails.overview = {};
    shareOtherDetails.medalsOwned = {};
    shareOtherDetails.chart = {};
    shareOtherDetails.chart.threeMonth = {};
    shareOtherDetails.chart.oneYear = {};
    shareOtherDetails.gamesRelated = {};
    shareOtherDetails.adDownload = {};

    localStorage.setItem(Constant.storage.SHARE_OTHER_DETAILS, JSON.stringify(shareOtherDetails));
  }
})();

/**
 * @method getShareOtherDetails
 * @return {String}
 */
LocalDAO.getShareOtherDetails = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.SHARE_OTHER_DETAILS));
};

/**
 * @method setShareOtherDetails
 * @return 无返回值
 */
LocalDAO.setShareOtherDetails = function (shareOtherDetails) {
  localStorage.setItem(Constant.storage.SHARE_OTHER_DETAILS, JSON.stringify(shareOtherDetails));
};

// 本人详情分享页
LocalDAO.initShareSelfDetails = (function () {
  if (localStorage.getItem(Constant.storage.SHARE_SELF_DETAILS) == null) {

    var shareSelfDetails = {};

    shareSelfDetails.overview = {};
    shareSelfDetails.medalsOwned = {};
    shareSelfDetails.chart = {};
    shareSelfDetails.chart.threeMonth = {};
    shareSelfDetails.chart.oneYear = {};
    shareSelfDetails.others = {};
    shareSelfDetails.adDownload = {};

    localStorage.setItem(Constant.storage.SHARE_SELF_DETAILS, JSON.stringify(shareSelfDetails));
  }
})();

/**
 * @method getShareSelfDetails
 * @return {String}
 */
LocalDAO.getShareSelfDetails = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.SHARE_SELF_DETAILS));
};

/**
 * @method setShareSelfDetails
 * @return 无返回值
 */
LocalDAO.setShareSelfDetails = function (shareSelfDetails) {
  localStorage.setItem(Constant.storage.SHARE_SELF_DETAILS, JSON.stringify(shareSelfDetails));
};

// 我订阅的牛人分享页
LocalDAO.initShareSubscriptions = (function () {
  if (localStorage.getItem(Constant.storage.SHARE_SUBSCRIPTIONS) == null) {

    var shareSubscriptions = {};

    shareSubscriptions.rockmans = {};
    shareSubscriptions.adDownload = {};

    localStorage.setItem(Constant.storage.SHARE_SUBSCRIPTIONS, JSON.stringify(shareSubscriptions));
  }
})();

/**
 * @method getShareSubscriptions
 * @return {String}
 */
LocalDAO.getShareSubscriptions = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.SHARE_SUBSCRIPTIONS));
};

/**
 * @method setShareSubscriptions
 * @return 无返回值
 */
LocalDAO.setShareSubscriptions = function (shareSubscriptions) {
  localStorage.setItem(Constant.storage.SHARE_SUBSCRIPTIONS, JSON.stringify(shareSubscriptions));
};

// 比赛详情分享页
LocalDAO.initShareGameDetails = (function () {
  if (localStorage.getItem(Constant.storage.SHARE_GAME_DETAILS) == null) {

    var shareGameDetails = {};

    shareGameDetails.overview = {};
    shareGameDetails.ranking = {};
    shareGameDetails.players = {};
    shareGameDetails.adDownload = {};

    localStorage.setItem(Constant.storage.SHARE_GAME_DETAILS, JSON.stringify(shareGameDetails));
  }
})();
/**
 * @method getShareGameDetails
 * @return {String}
 */
LocalDAO.getShareGameDetails = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.SHARE_GAME_DETAILS));
};

/**
 * @method setShareGameDetails
 * @return 无返回值
 */
LocalDAO.setShareGameDetails = function (shareGameDetails) {
  localStorage.setItem(Constant.storage.SHARE_GAME_DETAILS, JSON.stringify(shareGameDetails));
};

//我的比赛持仓分享页
LocalDAO.initShareGameSelfDetails = (function () {
  if (localStorage.getItem(Constant.storage.SHARE_GAME_SELF_DETAIL) == null) {

    var shareGameSelfDetails = {};

    shareGameSelfDetails.gameAsset = {};
    shareGameSelfDetails.gamePosition = {};

    localStorage.setItem(Constant.storage.SHARE_GAME_SELF_DETAIL, JSON.stringify(shareGameSelfDetails));
  }
})();

/**
 * @method getShareGameSelfDetails
 * @return {String}
 */
LocalDAO.getShareGameSelfDetails = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.SHARE_GAME_SELF_DETAIL));
};

/**
 * @method setShareGameSelfDetails
 * @return 无返回值
 */
LocalDAO.setShareGameSelfDetails = function (shareGameSelfDetails) {
  localStorage.setItem(Constant.storage.SHARE_GAME_SELF_DETAIL, JSON.stringify(shareGameSelfDetails));
};

// 比赛邀请分享页
LocalDAO.initShareGameInvite = (function () {
  if (localStorage.getItem(Constant.storage.SHARE_GAME_INVITE) == null) {
    var shareGameInvite = {};

    shareGameInvite.overview = {};
    shareGameInvite.password = {};
    shareGameInvite.adDownload = {};

    localStorage.setItem(Constant.storage.SHARE_GAME_INVITE, JSON.stringify(shareGameInvite));
  }
})();

/**
 * @method getShareGameInvite
 * @return {String}
 */
LocalDAO.getShareGameInvite = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.SHARE_GAME_INVITE));
};

/**
 * @method setShareGameInvite
 * @return 无返回值
 */
LocalDAO.setShareGameInvite = function (shareGameInvite) {
  localStorage.setItem(Constant.storage.SHARE_GAME_INVITE, JSON.stringify(shareGameInvite));
};

//炒股基础规则详情页
LocalDAO.initStockBaseDetail  = (function () {
  if (localStorage.getItem(Constant.storage.STOCK_BASE_DETAIL) == null) {
    var stockBaseDetail = {};

    stockBaseDetail.title = '';
    stockBaseDetail.textIndex = '';
    stockBaseDetail.page = '';
    stockBaseDetail.adDownload = {};

    localStorage.setItem(Constant.storage.STOCK_BASE_DETAIL, JSON.stringify(stockBaseDetail));
  }
})();

/**
 * @method getStockBaseDetail
 * @return {String}
 */
LocalDAO.getStockBaseDetail = function () {
  return JSON.parse(localStorage.getItem(Constant.page.STOCK_BASE_DETAIL));
};

/**
 * @method setStockBaseDetail
 * @return 无返回值
 */
LocalDAO.setStockBaseDetail = function (stockBaseDetail) {
  localStorage.setItem(Constant.page.STOCK_BASE_DETAIL, JSON.stringify(stockBaseDetail));
};

//基金基础规则详情页
LocalDAO.initFundBaseDetail  = (function () {
  if (localStorage.getItem(Constant.storage.FUND_BASE_DETAIL) == null) {
    var fundBaseDetail = {};

    fundBaseDetail.title = '';
    fundBaseDetail.textIndex = '';
    fundBaseDetail.page = '';
    fundBaseDetail.adDownload = {};

    localStorage.setItem(Constant.storage.FUND_BASE_DETAIL, JSON.stringify(fundBaseDetail));
  }
})();

/**
 * @method getFundBaseDetail
 * @return {String}
 */
LocalDAO.getFundBaseDetail = function () {
  return JSON.parse(localStorage.getItem(Constant.page.FUND_BASE_DETAIL));
};

/**
 * @method setFundBaseDetail
 * @return 无返回值
 */
LocalDAO.setFundBaseDetail = function (fundBaseDetail) {
  localStorage.setItem(Constant.page.FUND_BASE_DETAIL, JSON.stringify(fundBaseDetail));
};

// 新手指南
LocalDAO.initTutorial = (function () {
  if (localStorage.getItem(Constant.storage.TUTORIAL) == null) {
    var tutorial = {};
    localStorage.setItem(Constant.storage.TUTORIAL, JSON.stringify(tutorial));
  }
})();

/**
 * @method getTutorial
 * @return {String}
 */
LocalDAO.getTutorial = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.TUTORIAL));
};

/**
 * @method setTutorial
 * @return 无返回值
 */
LocalDAO.setTutorial = function (tutorial) {
  localStorage.setItem(Constant.storage.TUTORIAL, JSON.stringify(tutorial));
};

/**
 * 老何建议
 * @method getLhfpRecommended
 * @return {String}
 */
LocalDAO.getLhfpRecommended = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.SHARE_LHFP_DETAILS));
};
/**
 * 老何建议
 * @method setLhfpRecommended
 * @return 无返回值
 */
LocalDAO.setLhfpRecommended = function (shareRecommended) {
  localStorage.setItem(Constant.storage.SHARE_LHFP_DETAILS, JSON.stringify(shareRecommended));
};

/**
 * 获取用户代码
 * @method getUserCode
 * @return {String}
 */
LocalDAO.getUserCode = function () {
  return localStorage.getItem(Constant.storage.USER_CODE);
};

/**
 * 设置用户代码
 * @method setUserCode
 * @return 无返回值
 */
LocalDAO.setUserCode = function (userCode) {
  localStorage.setItem(Constant.storage.USER_CODE, userCode);
};

/**
 * 获取当前被查看牛人用户代码
 * @method getOtherUserCode
 * @return {String}
 */
LocalDAO.getOtherUserCode = function () {
  return localStorage.getItem(Constant.storage.OTHER_USER_CODE);
};

/**
 * 设置获取当前被查看牛人用户代码
 * @method setOtherUserCode
 * @return 无返回值
 */
LocalDAO.setOtherUserCode = function (otherUserCode) {
  localStorage.setItem(Constant.storage.OTHER_USER_CODE, otherUserCode);
};

/**
 * 获取昵称
 * @method getNickname
 * @return {String}
 */
LocalDAO.getNickname = function () {
  return localStorage.getItem(Constant.storage.NICKNAME);
};

/**
 * 设置昵称
 * @method setNickname
 * @return 无返回值
 */
LocalDAO.setNickname = function (nickname) {
  localStorage.setItem(Constant.storage.NICKNAME, nickname);
};

/**
 * 获取当前被查看牛人昵称
 * @method getOtherNickname
 * @return {String}
 */
LocalDAO.getOtherNickname = function () {
  return localStorage.getItem(Constant.storage.OTHER_NICKNAME);
};

/**
 * 设置当前被查看牛人昵称
 * @method setOtherNickname
 * @return 无返回值
 */
LocalDAO.setOtherNickname = function (otherNickname) {
  localStorage.setItem(Constant.storage.OTHER_NICKNAME, otherNickname);
};

/**
 * 设置头像路径
 * @method getUserHead
 * @return {String}
 */
LocalDAO.getUserHead = function () {
  return localStorage.getItem(Constant.storage.USER_HEAD);
};

/**
 * 获取头像路径
 * @method setUserHead
 * @return 无返回值
 */
LocalDAO.setUserHead = function (userHead) {
  localStorage.setItem(Constant.storage.USER_HEAD, userHead);
};

/**
 * 设置当前被查看牛人头像路径
 * @method getOtherUserHead
 * @return {String}
 */
LocalDAO.getOtherUserHead = function () {
  return localStorage.getItem(Constant.storage.OTHER_USER_HEAD);
};

/**
 * 获取当前被查看牛人头像路径
 * @method setOtherUserHead
 * @return 无返回值
 */
LocalDAO.setOtherUserHead = function (otherUserHead) {
  localStorage.setItem(Constant.storage.OTHER_USER_HEAD, otherUserHead);
};

/**
 * 设置君元宝数
 * @method getWalletTotal
 * @return {String}
 */
LocalDAO.getWalletTotal = function () {
  return localStorage.getItem(Constant.storage.WALLET_TOTAL);
};

/**
 * 获取君元宝数
 * @method setWalletTotal
 * @return 无返回值
 */
LocalDAO.setWalletTotal = function (walletTotal) {
  localStorage.setItem(Constant.storage.WALLET_TOTAL, walletTotal);
};

/**
 * 设置当前被查看牛人君元宝数
 * @method getOtherWalletTotal
 * @return {String}
 */
LocalDAO.getOtherWalletTotal = function () {
  return localStorage.getItem(Constant.storage.OTHER_WALLET_TOTAL);
};

/**
 * 获取当前被查看牛人君元宝数
 * @method setOtherWalletTotal
 * @return 无返回值
 */
LocalDAO.setOtherWalletTotal = function (otherWalletTotal) {
  localStorage.setItem(Constant.storage.OTHER_WALLET_TOTAL, otherWalletTotal);
};

/**
 * 设置总盈利率
 * @method getTotalRate
 * @return {String}
 */
LocalDAO.getTotalRate = function () {
  return localStorage.getItem(Constant.storage.TOTAL_RATE);
};

/**
 * 获取总盈利率
 * @method setTotalRate
 * @return 无返回值
 */
LocalDAO.setTotalRate = function (totalRate) {
  localStorage.setItem(Constant.storage.TOTAL_RATE, totalRate);
};

/**
 * 设置今日盈亏率
 * @method getDayRate
 * @return {String}
 */
LocalDAO.getDayRate = function () {
  return localStorage.getItem(Constant.storage.DAY_RATE);
};

/**
 * 获取今日盈亏率
 * @method setDayRate
 * @return 无返回值
 */
LocalDAO.setDayRate = function (dayRate) {
  localStorage.setItem(Constant.storage.DAY_RATE, dayRate);
};

/**
 * 设置累计盈亏金额
 * @method getTotalFloatProfit
 * @return {String}
 */
LocalDAO.getTotalFloatProfit = function () {
  return localStorage.getItem(Constant.storage.TOTAL_FLOAT_PROFIT);
};

/**
 * 获取累计盈亏金额
 * @method setTotalFloatProfit
 * @return 无返回值
 */
LocalDAO.setTotalFloatProfit = function (totalFloatProfit) {
  localStorage.setItem(Constant.storage.TOTAL_FLOAT_PROFIT, totalFloatProfit);
};

/**
 * 设置总资产金额
 * @method getFundBalance
 * @return {String}
 */
LocalDAO.getFundBalance = function () {
  return localStorage.getItem(Constant.storage.FUND_BALANCE);
};

/**
 * 获取总资产金额
 * @method setFundBalance
 * @return 无返回值
 */
LocalDAO.setFundBalance = function (fundBalance) {
  localStorage.setItem(Constant.storage.FUND_BALANCE, fundBalance);
};

/**
 * 设置可用资产金额
 * @method getEnableBalance
 * @return {String}
 */
LocalDAO.getEnableBalance = function () {
  return localStorage.getItem(Constant.storage.ENABLE_BALANCE);
};

/**
 * 获取可用资产金额
 * @method setEnableBalance
 * @return 无返回值
 */
LocalDAO.setEnableBalance = function (enableBalance) {
  localStorage.setItem(Constant.storage.ENABLE_BALANCE, enableBalance);
};


/**
 * 设置点赞总人数
 * @method getEnableBalance
 * @return {String}
 */
LocalDAO.getThumbUpNum = function () {
  return localStorage.getItem(Constant.storage.THUMB_UP_NUM);
};

/**
 * 获取点赞总人数
 * @method setEnableBalance
 * @return 无返回值
 */
LocalDAO.setThumbUpNum = function (thumbUpNum) {
  localStorage.setItem(Constant.storage.THUMB_UP_NUM, thumbUpNum);
};


/**
 * 设置订阅我的人数
 * @method getSubscribeUserCount
 * @return {String}
 */
LocalDAO.getSubscribeUserCount = function () {
  return localStorage.getItem(Constant.storage.SUBSCRIBE_USER_COUNT);
};

/**
 * 获取我订阅的人数
 * @method setMySubscribeCount
 * @return 无返回值
 */
LocalDAO.setMySubscribeCount = function (mySubscribeCount) {
  localStorage.setItem(Constant.storage.MY_SUBSCRIBE_COUNT, mySubscribeCount);
};

/**
 * 设置我订阅的人数
 * @method getMySubscribeCount
 * @return {String}
 */
LocalDAO.getMySubscribeCount = function () {
  return localStorage.getItem(Constant.storage.MY_SUBSCRIBE_COUNT);
};

/**
 * 获取订阅数
 * @method setSubscribeUserCount
 * @return 无返回值
 */
LocalDAO.setSubscribeUserCount = function (subscribeUserCount) {
  localStorage.setItem(Constant.storage.SUBSCRIBE_USER_COUNT, subscribeUserCount);
};


/**
 * 设置消息数
 * @method getMessages
 * @return {String}
 */
LocalDAO.getMessages = function () {
  return localStorage.getItem(Constant.storage.MESSAGES);
};

/**
 * 获取消息数
 * @method setMessages
 * @return 无返回值
 */
LocalDAO.setMessages = function (messages) {
  localStorage.setItem(Constant.storage.MESSAGES, messages);
};

/**
 * 设置订阅累计收益
 * @method getSubscribeIncome
 * @return {String}
 */
LocalDAO.getSubscribeIncome = function () {
  return localStorage.getItem(Constant.storage.SUBSCRIBE_INCOME);
};

/**
 * 获取订阅累计收益
 * @method setSubscribeIncome
 * @return 无返回值
 */
LocalDAO.setSubscribeIncome = function (subscribeIncome) {
  localStorage.setItem(Constant.storage.SUBSCRIBE_INCOME, subscribeIncome);
};

/**
 * 设置粉丝总人数
 * @method getSubscribePersonCount
 * @return {String}
 */
LocalDAO.getSubscribePersonCount = function () {
  return localStorage.getItem(Constant.storage.SUBSCRIBE_PERSON_COUNT);
};

/**
 * 获取粉丝总人数
 * @method setSubscribePersonCount
 * @return 无返回值
 */
LocalDAO.setSubscribePersonCount = function (subscribePersonCount) {
  localStorage.setItem(Constant.storage.SUBSCRIBE_PERSON_COUNT, subscribePersonCount);
};

/**
 * 设置本月新增订阅数
 * @method getMonthSubscribeCount
 * @return {String}
 */
LocalDAO.getMonthSubscribeCount = function () {
  return localStorage.getItem(Constant.storage.MONTH_SUBSCRIBE_COUNT);
};

/**
 * 获取本月新增订阅数
 * @method setMonthSubscribeCount
 * @return 无返回值
 */
LocalDAO.setMonthSubscribeCount = function (messages) {
  localStorage.setItem(Constant.storage.MONTH_SUBSCRIBE_COUNT, messages);
};

/**
 * 设置订阅价
 * @method getSubscribePrice
 * @return {String}
 */
LocalDAO.getSubscribePrice = function () {
  return localStorage.getItem(Constant.storage.SUBSCRIBE_PRICE);
};

/**
 * 获取订阅价
 * @method setSubscribePrice
 * @return 无返回值
 */
LocalDAO.setSubscribePrice = function (subscribePrice) {
  localStorage.setItem(Constant.storage.SUBSCRIBE_PRICE, subscribePrice);
};

/**
 * 设置点赞数
 * @method getGoodpointCount
 * @return {String}
 */
LocalDAO.getGoodpointCount = function () {
  return localStorage.getItem(Constant.storage.GOODPOINT_COUNT);
};

/**
 * 获取点赞数
 * @method setGoodpointCount
 * @return 无返回值
 */
LocalDAO.setGoodpointCount = function (goodpointCount) {
  localStorage.setItem(Constant.storage.GOODPOINT_COUNT, goodpointCount);
};

/**
 * 获取当前用户所获勋章列表
 * @method getMedalsOwned
 * @return {JSON}
 */
LocalDAO.getMedalsOwned = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.MEDALS_OWNED));
};

/**
 * 设置当前用户所获勋章列表
 * @method setMedalsOwned
 * @return 无返回值
 */
LocalDAO.setMedalsOwned = function (medalsOwned) {
  localStorage.setItem(Constant.storage.MEDALS_OWNED, JSON.stringify(medalsOwned));
};

/**
 * 获取当前被查看用户所获勋章列表
 * @method getOtherMedalsOwned
 * @return {JSON}
 */
LocalDAO.getOtherMedalsOwned = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.OTHER_MEDALS_OWNED));
};

/**
 * 设置当前被查看用户所获勋章列表
 * @method setOtherMedalsOwned
 * @return 无返回值
 */
LocalDAO.setOtherMedalsOwned = function (otherMedalsOwned) {
  localStorage.setItem(Constant.storage.OTHER_MEDALS_OWNED, JSON.stringify(otherMedalsOwned));
};

/**
 * 获取所有勋章列表
 * @method getMedalsAll
 * @return {JSON}
 */
LocalDAO.getMedalsAll = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.MEDALS_ALL));
};

/**
 * 设置所有勋章列表
 * @method setMedalsAll
 * @return 无返回值
 */
LocalDAO.setMedalsAll = function (medalsAll) {

  localStorage.setItem(Constant.storage.MEDALS_ALL, JSON.stringify(medalsAll));
};

/**
 * 获取牛人秀列表
 * @method getRockmansShow
 * @return {JSON}
 */
LocalDAO.getRockmansShow = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.ROCKMANS_SHOW));
};

/**
 * 设置牛人秀列表
 * @method setRockmansShow
 * @return 无返回值
 */
LocalDAO.setRockmansShow = function (rockmansShow) {
  localStorage.setItem(Constant.storage.ROCKMANS_SHOW, JSON.stringify(rockmansShow));
};

/**
 * 获取组合秀列表
 * @method getPortfoliosShow
 * @return {JSON}
 */
LocalDAO.getPortfoliosShow = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.PORTFOLIOS_SHOW));
};

/**
 * 设置组合秀列表
 * @method setPortfoliosShow
 * @return 无返回值
 */
LocalDAO.setPortfoliosShow = function (portfoliosShow) {
  localStorage.setItem(Constant.storage.PORTFOLIOS_SHOW, JSON.stringify(portfoliosShow));
};


/**
 * 获取点赞我的牛人列表
 * @method getRockmansAdmirers
 * @return {JSON}
 */
LocalDAO.getRockmansAdmirers = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.ROCKMANS_ADMIRERS));
};

/**
 * 设置点赞我的牛人列表
 * @method setRockmansAdmirers
 * @return 无返回值
 */
LocalDAO.setRockmansAdmirers = function (rockmansAdmirers) {
  localStorage.setItem(Constant.storage.ROCKMANS_ADMIRERS, JSON.stringify(rockmansAdmirers));
};

/**
 * 获取我的粉丝列表
 * @method getRockmansFans
 * @return {JSON}
 */
LocalDAO.getRockmansFans = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.ROCKMANS_FANS));
};

/**
 * 设置我的粉丝列表
 * @method setRockmansFans
 * @return 无返回值
 */
LocalDAO.setRockmansFans = function (rockmansFans) {
  localStorage.setItem(Constant.storage.ROCKMANS_FANS, JSON.stringify(rockmansFans));
};


/**
 * 获取比赛：个人PK
 */
LocalDAO.getGamesPersonalPK = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.GAMES_PERSONAL_PK));
};

/**
 *设置比赛：个人PK
 * @param personalPK
 */
LocalDAO.setGamesPersonalPK = function (personalPK) {
  localStorage.setItem(Constant.storage.GAMES_PERSONAL_PK, JSON.stringify(personalPK));
};

/**
 * 获取官方比赛列表
 * @method getGamesOfficial
 * @return {JSON}
 */
LocalDAO.getGamesOfficial = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.GAMES_OFFICIAL));
};

/**
 * 设置官方比赛列表
 * @method setGamesOfficial
 * @return 无返回值
 */
LocalDAO.setGamesOfficial = function (gamesOfficial) {
  localStorage.setItem(Constant.storage.GAMES_OFFICIAL, JSON.stringify(gamesOfficial));
};

/**
 * 获取订阅的牛人列表
 * @method getRockmansSub
 * @return {JSON}
 */
LocalDAO.getRockmansSub = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.ROCKMANS_SUB));
};

/**
 * 设置订阅的牛人列表
 * @method setRockmansSub
 * @return 无返回值
 */
LocalDAO.setRockmansSub = function (rockmansSub) {
  localStorage.setItem(Constant.storage.ROCKMANS_SUB, JSON.stringify(rockmansSub));
};

/**
 * 获取参加的比赛列表
 * @method getGamesJoin
 * @return {JSON}
 */
LocalDAO.getGamesJoin = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.GAMES_JOIN));
};

/**
 * 设置参加的比赛列表
 * @method setGamesJoin
 * @return 无返回值
 */
LocalDAO.setGamesJoin = function (gamesJoin) {
  localStorage.setItem(Constant.storage.GAMES_JOIN, JSON.stringify(gamesJoin));
};

/**
 * 获取创建的比赛列表
 * @method getGamesCreate
 * @return {JSON}
 */
LocalDAO.getGamesCreate = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.GAMES_CREATE));
};

/**
 * 设置创建的比赛列表
 * @method setGamesCreate
 * @return 无返回值
 */
LocalDAO.setGamesCreate = function (gamesCreate) {
  localStorage.setItem(Constant.storage.GAMES_CREATE, JSON.stringify(gamesCreate));
};

/**
 * 获取比赛投票榜
 * @method setGameVote
 * @return 无返回值
 */
LocalDAO.getGameVote = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.GAME_VOTE));
};

/**
 * 设置比赛投票榜
 * @method setGameVote
 * @return 无返回值
 */
LocalDAO.setGameVote = function (gameVote) {
  localStorage.setItem(Constant.storage.GAME_VOTE, JSON.stringify(gameVote));
};

/**
 * 获取我的个股列表
 * @method getMyStocks
 * @return {JSON}
 */
LocalDAO.getMyStocks = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.MY_STOCKS));
};

/**
 * 设置我的个股列表
 * @method setMyStocks
 * @return 无返回值
 */
LocalDAO.setMyStocks = function (myStocks) {
  localStorage.setItem(Constant.storage.MY_STOCKS, JSON.stringify(myStocks));
};

/**
 * 获取他人个股列表
 * @method getOtherStocks
 * @return {JSON}
 */
LocalDAO.getOtherStocks = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.OTHER_STOCKS));
};

/**
 * 设置他人个股列表
 * @method setOtherStocks
 * @return 无返回值
 */
LocalDAO.setOtherStocks = function (otherStocks) {
  localStorage.setItem(Constant.storage.OTHER_STOCKS, JSON.stringify(otherStocks));
};

/**
 * 移除他人个股列表
 * @method removeOtherStocks
 * @return 无返回值
 */
LocalDAO.removeOtherStocks = function () {
  localStorage.removeItem(Constant.storage.OTHER_STOCKS);
};

/**
 * 获取我的组合列表
 * @method getMyPortfolios
 * @return {JSON}
 */
LocalDAO.getMyPortfolios = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.MY_PORTFOLIOS));
};

/**
 * 设置我的组合列表
 * @method setMyPortfolios
 * @return 无返回值
 */
LocalDAO.setMyPortfolios = function (myPortfolios) {
  localStorage.setItem(Constant.storage.MY_PORTFOLIOS, JSON.stringify(myPortfolios));
};

/**
 * 获取我的比赛持仓信息的上半部分
 * @method getMyGameAsset
 * @return {JSON}
 */
LocalDAO.getMyGameAsset = function () {
  return JSON.parse(localStorage.getItem(Constant.game.position.GAMEASSET));
};

/**
 * 设置我的比赛持仓信息的上半部分
 * @method setMyGameAsset
 * @return 无返回值
 */
LocalDAO.setMyGameAsset = function (myGameAsset) {
  localStorage.setItem(Constant.game.position.GAMEASSET, JSON.stringify(myGameAsset));
};

/**
 * 获取我的比赛持仓信息的下半部分
 * @method getMyGameAssetDetail
 * @return {JSON}
 */
LocalDAO.getMyGameAssetDetail = function () {
  return JSON.parse(localStorage.getItem(Constant.game.position.GAMEASSETDETAIL));
};

/**
 * 设置我的比赛持仓信息的下半部分
 * @method setMyGameAssetDetail
 * @return 无返回值
 */
LocalDAO.setMyGameAssetDetail = function (myGameAssetDetail) {
  localStorage.setItem(Constant.game.position.GAMEASSETDETAIL, JSON.stringify(myGameAssetDetail));
};

/**
 * 获取他人组合列表
 * @method getOtherPortfolios
 * @return {JSON}
 */
LocalDAO.getOtherPortfolios = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.OTHER_PORTFOLIOS));
};

/**
 * 设置他人组合列表
 * @method setOtherPortfolios
 * @return 无返回值
 */
LocalDAO.setOtherPortfolios = function (otherPortfolios) {
  localStorage.setItem(Constant.storage.OTHER_PORTFOLIOS, JSON.stringify(otherPortfolios));
};

/**
 * 移除他人组合列表
 * @method removeOtherPortfolios
 * @return 无返回值
 */
LocalDAO.removeOtherPortfolios = function () {
  localStorage.removeItem(Constant.storage.OTHER_PORTFOLIOS);
};

/**
 * 初始化我的比赛列表
 */
LocalDAO.initGameMy = function () {
  var item = {gameList: []};
  if (localStorage.getItem(Constant.storage.GAME_PLAY) == null) {
    localStorage.setItem(Constant.storage.GAME_PLAY, JSON.stringify(item));
  }
  if (localStorage.getItem(Constant.storage.GAME_BUILD) == null) {
    localStorage.setItem(Constant.storage.GAME_BUILD, JSON.stringify(item));
  }
};
/**
 * 设置我参加的比赛列表
 * @method getGamePlay
 * @return {JSON}
 */
LocalDAO.setGamePlay = function (gamePlay) {
  localStorage.setItem(Constant.storage.GAME_PLAY, JSON.stringify(gamePlay));
};

/**
 * 获取我参加的比赛列表
 * @method getGamePlay
 * @return {JSON}
 */
LocalDAO.getGamePlay = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.GAME_PLAY));
};

/**
 * 设置我建立的比赛列表
 * @method getGameBuild
 * @return {JSON}
 */
LocalDAO.setGameBuild = function (gameBuild) {
  localStorage.setItem(Constant.storage.GAME_BUILD, JSON.stringify(gameBuild));
};

/**
 * 获取我建立的比赛列表
 * @method getGameBuild
 * @return {JSON}
 */
LocalDAO.getGameBuild = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.GAME_BUILD));
};

/**
 *初始化组合详情
 */
LocalDAO.initPortfolioDetail = function () {
  var group = {
    "group_id": "-",
    "group_name": "--",
    "statue": 0,
    "total_profit": 0,
    "total_profitrate": 0,
    "month_changecount": 0,
    "create_date": "----",
    "bstealnum": 0,
    "user_head": Constant.url.DEFAULT_USER_HEAD,
    "nick_name": "--"
  };
  localStorage.setItem(Constant.storage.PORTFOLI_DETAIL, JSON.stringify(group));
  var transfer = {"record": [], "describe": "暂无调仓记录"};
  localStorage.setItem(Constant.storage.PORTFOLI_TRANSFER, JSON.stringify(transfer));
  var position = {"group_statue": 1, "stockBlocks": [], "describe": "暂无持仓记录"};
  localStorage.setItem(Constant.storage.PORTFOLI_POSITION, JSON.stringify(position));
  var similar = {"groupList": []};
  localStorage.setItem(Constant.storage.PORTFOLI_SIMILAR, JSON.stringify(similar));
};

/**
 * 设置组合详情
 * @method setPortfolioDetail
 * @return {JSON}
 */
LocalDAO.setPortfolioDetail = function (portfolioDetail) {
  localStorage.setItem(Constant.storage.PORTFOLI_DETAIL, JSON.stringify(portfolioDetail));
};

/**
 * 获取组合详情
 * @method setPortfolioDetail
 * @return {JSON}
 */
LocalDAO.getPortfolioDetail = function () {
  if (localStorage.getItem(Constant.storage.PORTFOLI_DETAIL) == null) {
    var item =
    {
      "group_id": "-",
      "group_name": "--",
      "statue": 0,
      "total_profit": 0,
      "total_profitrate": 0,
      "month_changecount": 0,
      "create_date": "----",
      "bstealnum": 0,
      "user_head": Constant.url.DEFAULT_USER_HEAD,
      "nick_name": "--"
    };
    localStorage.setItem(Constant.storage.PORTFOLI_DETAIL, JSON.stringify(item));
  }
  return JSON.parse(localStorage.getItem(Constant.storage.PORTFOLI_DETAIL));
};

/**
 * 设置组合调仓
 * @method setPortfolioTransfer
 * @return {JSON}
 */
LocalDAO.setPortfolioTransfer = function (portfolioTransfer) {
  localStorage.setItem(Constant.storage.PORTFOLI_TRANSFER, JSON.stringify(portfolioTransfer));
};

/**
 * 获取组合调仓
 * @method setPortfolioTransfer
 * @return {JSON}
 */
LocalDAO.getPortfolioTransfer = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.PORTFOLI_TRANSFER));
};

/**
 * 设置组合持仓
 * @method setPortfolioPosition
 * @return {JSON}
 */
LocalDAO.setPortfolioPosition = function (portfolioPosition) {
  localStorage.setItem(Constant.storage.PORTFOLI_POSITION, JSON.stringify(portfolioPosition));
};

/**
 * 获取组合持仓
 * @method setPortfolioPosition
 * @return {JSON}
 */
LocalDAO.getPortfolioPosition = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.PORTFOLI_POSITION));
};

/**
 * 设置相似组合
 * @method setPortfolioSimilar
 * @return {JSON}
 */
LocalDAO.setPortfolioSimilar = function (portfolioSimilar) {
  localStorage.setItem(Constant.storage.PORTFOLI_SIMILAR, JSON.stringify(portfolioSimilar));
};

/**
 * 获取相似组合
 * @method setPortfolioSimilar
 * @return {JSON}
 */
LocalDAO.getPortfolioSimilar = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.PORTFOLI_SIMILAR));
};

/**
 * 初始化最牛组合列表
 * @method getPortfolioDayProfit
 * @return {JSON}
 */
LocalDAO.initRockPortfolio = function () {
  var item = {
    groupList: [
      {
        "group_name": "-",
        "group_id": "-",
        "client_id": "-",
        "nickname": "- ",
        "stealers": 0,
        "total_profit": 0,
        "block_text": [],
        "day_profit": 0,
        "month_profit": 0
      },
      {
        "group_name": "-",
        "group_id": "-",
        "client_id": "-",
        "nickname": "- ",
        "stealers": 0,
        "total_profit": 0,
        "block_text": [],
        "day_profit": 0,
        "month_profit": 0
      },
      {
        "group_name": "-",
        "group_id": "-",
        "client_id": "-",
        "nickname": "- ",
        "stealers": 0,
        "total_profit": 0,
        "block_text": [],
        "day_profit": 0,
        "month_profit": 0
      },
      {
        "group_name": "-",
        "group_id": "-",
        "client_id": "-",
        "nickname": "- ",
        "stealers": 0,
        "total_profit": 0,
        "block_text": [],
        "day_profit": 0,
        "month_profit": 0
      },
      {
        "group_name": "-",
        "group_id": "-",
        "client_id": "-",
        "nickname": "- ",
        "stealers": 0,
        "total_profit": 0,
        "block_text": [],
        "day_profit": 0,
        "month_profit": 0
      }
    ]
  };
  if (localStorage.getItem(Constant.storage.ROCK_PORTFOLIO_DAY) == null) {
    localStorage.setItem(Constant.storage.ROCK_PORTFOLIO_DAY, JSON.stringify(item));
  }
  if (localStorage.getItem(Constant.storage.ROCK_PORTFOLIO_MONTH) == null) {
    localStorage.setItem(Constant.storage.ROCK_PORTFOLIO_MONTH, JSON.stringify(item));
  }
  if (localStorage.getItem(Constant.storage.ROCK_PORTFOLIO_TOTAL) == null) {
    localStorage.setItem(Constant.storage.ROCK_PORTFOLIO_TOTAL, JSON.stringify(item));
  }
  if (localStorage.getItem(Constant.storage.ROCK_PORTFOLIO_POPULAR) == null) {
    localStorage.setItem(Constant.storage.ROCK_PORTFOLIO_POPULAR, JSON.stringify(item));
  }
};

/**
 * 设置最牛组合日收益列表
 * @method setRockPortfolioDay
 */
LocalDAO.setRockPortfolioDay = function (rockPortfolioDay) {
  localStorage.setItem(Constant.storage.ROCK_PORTFOLIO_DAY, JSON.stringify(rockPortfolioDay));
};

/**
 * 获取最牛组合日收益列表
 * @method getPortfolioDayProfit
 * @return {JSON}
 */
LocalDAO.getRockPortfolioDay = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.ROCK_PORTFOLIO_DAY));
};

/**
 * 设置最牛组合月收益列表
 * @method setPortfolioMonthProfit
 */
LocalDAO.setRockPortfolioMonth = function (rockPortfolioMonth) {
  localStorage.setItem(Constant.storage.ROCK_PORTFOLIO_MONTH, JSON.stringify(rockPortfolioMonth));
};

/**
 * 获取最牛组合月收益列表
 * @method getPortfolioMonthProfit
 * @return {JSON}
 */
LocalDAO.getRockPortfolioMonth = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.ROCK_PORTFOLIO_MONTH));
};


/**
 * 设置最牛组合总收益列表
 * @method getPortfolioMonthProfit
 * @return {JSON}
 */
LocalDAO.setRockPortfolioTotal = function (rockPortfolioTotal) {
  localStorage.setItem(Constant.storage.ROCK_PORTFOLIO_MONTH, JSON.stringify(rockPortfolioTotal));
};

/**
 * 获取最牛组合总收益列表
 * @method getPortfolioTotalProfit
 */
LocalDAO.getRockPortfolioTotal = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.ROCK_PORTFOLIO_TOTAL));
};

/**
 * 设置人气组合列表
 * @method getPortfolioPopular
 */
LocalDAO.setRockPortfolioPopular = function (rockPortfolioPopular) {
  localStorage.setItem(Constant.storage.ROCK_PORTFOLIO_POPULAR, JSON.stringify(rockPortfolioPopular));
};

/**
 * 获取人气组合列表
 * @method getPortfolioPopular
 * @return {JSON}
 */
LocalDAO.getRockPortfolioPopular = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.ROCK_PORTFOLIO_POPULAR));
};

/**
 * 初始化牛股列表
 * @method getRockStockBuy
 * @return {JSON}
 */
LocalDAO.initRockStock = function () {
  var item = {
    stockList: [
      {"stock_name": "-", "stock_code": "-", "last_price": 0, "vol": 0, "optionstock_flag": 0},
      {"stock_name": "-", "stock_code": "-", "last_price": 0, "vol": 0, "optionstock_flag": 0},
      {"stock_name": "-", "stock_code": "-", "last_price": 0, "vol": 0, "optionstock_flag": 0}
    ]
  };
  //牛人都在买
  if (localStorage.getItem(Constant.storage.ROCK_STOCK_BUY) == null) {
    localStorage.setItem(Constant.storage.ROCK_STOCK_BUY, JSON.stringify(item));
  }
  //牛人都在卖
  if (localStorage.getItem(Constant.storage.ROCK_STOCK_SELL) == null) {
    localStorage.setItem(Constant.storage.ROCK_STOCK_SELL, JSON.stringify(item));
  }
  //牛人都在看
  if (localStorage.getItem(Constant.storage.ROCK_STOCK_WATCH) == null) {
    localStorage.setItem(Constant.storage.ROCK_STOCK_WATCH, JSON.stringify(item));
  }
};

/**
 * 设置牛人都在买列表
 * @method setOtherStocks
 * @return 无返回值
 */
LocalDAO.setRockStockBuy = function (rockStockBuy) {
  localStorage.setItem(Constant.storage.ROCK_STOCK_BUY, JSON.stringify(rockStockBuy));
};

/**
 * 获取牛人都在买列表
 * @method getRockStockBuy
 * @return JSON
 */
LocalDAO.getRockStockBuy = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.ROCK_STOCK_BUY));
};

/**
 * 设置牛人都在卖列表
 * @method setRockStockSell
 * @return 无返回值
 */
LocalDAO.setRockStockSell = function (rockStockSell) {
  localStorage.setItem(Constant.storage.ROCK_STOCK_SELL, JSON.stringify(rockStockSell));
};

/**
 * 获取牛人都在卖列表
 * @method getRockStockSell
 * @return JSON
 */
LocalDAO.getRockStockSell = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.ROCK_STOCK_SELL));
};

/**
 * 设置牛人都在看列表
 * @method setOtherStocks
 * @return 无返回值
 */
LocalDAO.setRockStockWatch = function (rockStockWatch) {
  localStorage.setItem(Constant.storage.ROCK_STOCK_WATCH, JSON.stringify(rockStockWatch));
};

/**
 * 获取牛人都在看列表
 * @method getRockStockWatch
 * @return JSON
 */
LocalDAO.getRockStockWatch = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.ROCK_STOCK_WATCH));
};

/**
 * 设置我偷师的组合列表
 * @method setOtherStocks
 * @return 无返回值
 */
LocalDAO.setPortfolioMyLearn = function (portfolioMyLearn) {
  localStorage.setItem(Constant.storage.PORTFOLIO_MY_LEARN, JSON.stringify(portfolioMyLearn));
};

/**
 * 获取我偷师的组合列表
 * @method getRockStockWatch
 * @return JSON
 */
LocalDAO.getPortfolioMyLearn = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.PORTFOLIO_MY_LEARN));
};

/**
 * 获取易阳指前端token
 * @method getyyzToken
 * @return String
 */
LocalDAO.getyyzToken = function () {
  return JSON.parse(localStorage.getItem(Constant.YYZ_TOKEN));
};

/**
 * 设置易阳指前端token
 * @method setyyzToken
 * @return 无返回值
 */
LocalDAO.setyyzToken = function (token) {
  localStorage.setItem(Constant.YYZ_TOKEN, token);
};

/**
 * 获取我的自选股列表
 * @method getSelfStock
 * @return JSON
 */
LocalDAO.getSelfStock = function () {
  var selfData = localStorage.getItem(Constant.SELF_STOCK).split(",");
  return selfData;
};

/**
 * 重置我的自选股列表
 * @method setSelfStock
 * @return JSON
 */
LocalDAO.setSelfStock = function (mystock) {
  var stock = mystock.join(",");
  localStorage.setItem(Constant.SELF_STOCK, stock);
};

/**
 * 添加我的自选股
 * @method addSelfStock
 * @return JSON
 */
LocalDAO.addSelfStock = function (mystock) {
  console.log("add:" + mystock);
  var selfData = [];
  if (localStorage.getItem(Constant.SELF_STOCK) !== "") {
    selfData = localStorage.getItem(Constant.SELF_STOCK).split(",");
  }
  selfData.push(mystock);
  var selfStr = selfData.join(",");
  localStorage.setItem(Constant.SELF_STOCK, selfStr);
};

/**
 * 删除我的自选股
 * @method deleteSelfStock
 * @return JSON
 */
LocalDAO.deleteSelfStock = function (mystock) {
  console.log("delete:" + mystock);
  var selfData = localStorage.getItem(Constant.SELF_STOCK).split(",");
  var index = _.indexOf(selfData, mystock);
  selfData.splice(index, 1);
  localStorage.setItem(Constant.SELF_STOCK, selfData);
};

/**
 * 获取三个月收益曲线
 * @method getChartOptionMonth
 * @return {JSON}
 */
LocalDAO.getChartOptionMonth = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.CHART_OPTION_MONTH));
};

/**
 * 设置三个月收益曲线
 * @method setGamesJoin
 * @return 无返回值
 */
LocalDAO.setChartOptionMonth = function (chartOptionMonth) {
  localStorage.setItem(Constant.storage.CHART_OPTION_MONTH, JSON.stringify(chartOptionMonth));
};

/**
 * 获取年收益曲线
 * @method getChartOptionYear
 * @return {JSON}
 */
LocalDAO.getChartOptionYear = function () {
  return JSON.parse(localStorage.getItem(Constant.storage.CHART_OPTION_YEAR));
};

/**
 * 设置年收益曲线
 * @method setChartOptionYear
 * @return 无返回值
 */
LocalDAO.setChartOptionYear = function (chartOptionYear) {
  localStorage.setItem(Constant.storage.CHART_OPTION_YEAR, JSON.stringify(chartOptionYear));
};

LocalDAO.isFirst = function () {
  var isFirst = localStorage.getItem(Constant.storage.IS_FIRST);
  if (typeof(isFirst) == 'undefined' || isFirst == null || isFirst.length == 0) {
    isFirst = true;
  }
  return isFirst;
};

LocalDAO.setIsFirst = function (isFirst) {
  localStorage.setItem(Constant.storage.IS_FIRST, isFirst);
};

/**
 * 设置分享渠道号
 * @method setShareid
 * @return 无返回值
 */
LocalDAO.setShareid = function (shareid) {
  localStorage.setItem(Constant.storage.SHAREID, shareid);
};

/**
 * 获取分享渠道号
 * @method getShareid
 * @return String
 */
LocalDAO.getShareid = function () {
  return localStorage.getItem(Constant.storage.SHAREID);
};

/**
 * 设置 基金-用户须知是否已弹出过
 * @method setFundNeedKnow
 * @return 无返回值
 * value:true 弹出过
 */
LocalDAO.setFundNeedKnow = function (value) {
  localStorage.setItem(Constant.modal.FUND_NEED_KNOW_MODAL, value);
};

/**
 * 获取 基金-用户须知是否已弹出过
 * @method getFundNeedKnow
 * @return String
 */
LocalDAO.getFundNeedKnow= function (){
  return localStorage.getItem(Constant.modal.FUND_NEED_KNOW_MODAL);
}

export default LocalDAO

